one function to handle two events
removed temporary file (added accidentally)