Added overflow handling in the server (needs to be tested)