adding proper error handling!