fixed bugs with error notifications
fixed little ugly code
fixed some stuff