first implementation of background mode

more elegant implementation of the phone listener