adding code to handle sign errors